<div class="am-cf am-padding">
    <div class="am-fl am-cf">
        <strong class="am-text-primary am-text-lg">首页</strong> /
        <small>用户管理</small> /
        <small>修改用户</small>
    </div>
</div>

<!-- <div class="am-padding">
    <a class="am-btn am-btn-default am-btn-xs am-text-secondary" href="{:U('userUpdate')}">新增用户</a>
</div> -->

<div class="am-g">
    <div class="am-u-sm-12">
        <form id="user-form" class="am-form" action="{:U('userUpdate')}" method="POST">
            <div class="am-g am-margin-top-sm">
                <div class="am-u-sm-2 am-text-right">
                    用户名
                </div>
                <div class="am-u-sm-4 am-u-end">
                    <input type="hidden" name="id" value="{$user.id}">
                    <input type="text" class="am-input-sm" name="username" value="{$user.username}" readonly="readonly">
                </div>
            </div>

            <div class="am-g am-margin-top-sm">
                <div class="am-u-sm-2 am-text-right">
                    用户昵称
                </div>
                <div class="am-u-sm-4 am-u-end">
                    <input type="text" class="am-input-sm" name="nickname" value="{$user.nickname}">
                </div>
            </div>
                        
            <div class="am-g am-margin-top-sm">
                <div class="am-u-sm-2 am-text-right">
                    用户积分
                </div>
                <div class="am-u-sm-4 am-u-end">
                    <input type="text" class="am-input-sm" name="points" value="{$user.points}" placeholder="请输入整数">
                </div>
            </div>

            <div class="am-g am-margin-top-sm">
                <div class="am-u-sm-2 am-text-right">
                    用户等级
                </div>
                <div class="am-u-sm-4 am-u-end">
                    <input type="text" class="am-input-sm" name="level" value="{$user.level}" placeholder="请输入整数">
                </div>
            </div>
            <div class="am-g am-margin-top-sm">
                <div class="am-u-sm-2 am-text-right">
                    &nbsp;
                </div>
                <div class="am-u-sm-4 am-u-end">
                    <a id="sub" class="am-btn am-btn-default am-btn-xs am-text-secondary">提交</a>
                    <a class="am-btn am-btn-default am-btn-xs am-text-danger" href="{:U('user')}">取消</a>
                </div>
            </div>
        </form>

    </div>
</div>

<script>
    $(function () {
        $('#sub').click(function () {
            var f = $('#user-form')[0]
            f.submit();
        })
    })
</script>